#ifndef __SPACEDEFENDER_MovableObject_H__
#define __SPACEDEFENDER_MovableObject_H__

#include <string>
#include "util/cvector.h"
#include "util/quaternion.h"

#include "object.h"

namespace spacedefender
{

class MovableObject : public Object
{
	public:
		MovableObject(std::string type);
		MovableObject(std::string type, Vector startPos);
		~MovableObject();
		virtual bool Update();
		virtual Vector GetPosition() const;
		virtual Vector GetDirection() const;

		virtual const Quaternion& GetDirectionQuat() const;

		virtual void SetPosition(Vector newPos);
		virtual void SetDirection(Vector newDir);
		virtual void Yaw(float elapsedTime, bool notation);
		virtual void Pitch(float elapsedTime, bool notation);
		virtual void Roll(float elapsedTime, bool notation);

		virtual void SetRotateSpeed(float newSpeed);
		virtual void SetSpeed(float newSpeed);
		virtual void Move(float elapsedTime);
	private:

		void UpdateDirection();

		Vector _position;
		Vector _direction;
		Quaternion _quat;
		float _yaw;
		float _roll;
		float _pitch;

		float _rotateSpeed;
		float _speed;
};
}
#endif // __SPACEDEFENDER_MovableObject_H__
